package basic;
import Part.Camera;
import Part.Lock;
import Product.DoorLock;
import Product.DoorMonitor;
import Product.outputCarema;
import Product.outputLock;
public class BurglarProofDoor extends Door {
    private static String housenumber;
    private static String code;
    private Lock lock;
    private Camera camera;
    Handle handle;// 先不对门把手序列号进行初始化

    // 用于调用的构造方法
    public BurglarProofDoor() {

    }

    public BurglarProofDoor(Lock lock) {
        this.lock = lock;
    }

    // 物业后台-防盗门初始化
    public BurglarProofDoor(String owner, String housenumber, Lock lock, Camera camera) {
        super(owner);
        this.housenumber = housenumber;
        this.lock = lock;
        this.camera = camera;
    }

    // 物业后台-门把手初始化 门牌号赋值
    public class Handle {
        public Handle() {

        }

        public void turn() {
            System.out.println();
            System.out.println("##Welcome to use the Security System##");
            System.out.println("Dear " + BurglarProofDoor.getOwner() + ",");
        }
    }

    public void turnHandle() {
        handle = new Handle();
        handle.turn();
    }

    /**
     * 模拟锁头的方法
     */
    public void setLock(String _code) {
        lock.checkCode(_code);
        lock.unlock(_code);
        lock.lock(_code);
    }

    /**
     * 模拟监控的方法
     */
    public void setCamera() {
        camera.monitor();
    }

    // 物业后台-防盗门密码设置
    public void setCode(String code) {
        this.code = code;
        code.hashCode();
    }

    public static String returnCode() {
        return code;
    }

    // 物业后台-用户入住
    public void setHousenumber(String housenumber) {
        this.housenumber = housenumber;
    }

    public static String getHousenumber() {
        return housenumber;
    }

    // 开门关门
    public void open() {
        this.turnHandle();
        System.out.println("Room " + BurglarProofDoor.getHousenumber());
        System.out.println("Welcome, " + BurglarProofDoor.getOwner());
    }

    public void close() {
        this.turnHandle();
        System.out.println("Room " + BurglarProofDoor.getHousenumber());
        System.out.println("Get locked, " + BurglarProofDoor.getOwner());
    }

    // 组合锁和摄像头
    // 接口的实现类
    // 提供两个工厂类分别负责生成锁和摄像头的实例对象
    // 在主类中创建防盗门对象并调用相关方法
    // 定义表示一周七天的枚举类并遍历
}
